package com.example.api;

import io.swagger.annotations.Api;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import org.springframework.web.bind.annotation.RestController;


/**
 * Create with Intellij idea
 * User:鲁智明
 * Date:2018/11/25
 * Time:18:46
 */
@Api("SwaggerDemo控制器")   //整体接口描述
@RestController
public class SwaggerController {

    @ApiOperation("swagger测试接口")
    @GetMapping("/swaggerIndex")
    public String swaggerIndex(){
        System.out.println("swagger接口测试");
      return "swaggerIndex";
    }

    @ApiOperation("/获取会员相关信息")
    @ApiImplicitParam(name = "userName",value = "用户信息参数",required = true,dataType = "String")
    @PostMapping("/getMember")
    public String getMember(String userName){
        System.out.println("用户名:"+userName);
        return "用户名:"+userName;
    }
}
